# Description: The two functions is to evaluate the codon usage of a given codon.
# Author: Shibo Li, MiQroEra
# Date: 2023-07-15
# 

import RNA

def calculate_cai(mrna_sequence, codon_usage):
    cai = 1
    for i in range(0, len(mrna_sequence), 3):
        codon = mrna_sequence[i:i+3]
        cai *= codon_usage.get(codon, 0)
    return cai

def calculate_mfe(sequence):
    mfe = RNA.fold(sequence)[1]
    return mfe

